Vercel
API ReferenceMessages

Resolve Task (Streaming)

Resolves a pending task in a chat and returns a Server-Sent Events stream. Events include the initial assistant-message snapshot, content chunk deltas, final usage, and a closing message snapshot. The response is `text/event-stream`; each event is `data: <JSON>\n\n` where the JSON conforms to MessageStreamEvent.

POST/v2/chats/{chatId}/messages/resolve/stream

Usage

TypeScript Example
import { v0 } from 'v0-sdk'const result = await v0.messages.resolveStream({  chatId: 'chat_abc123',  task: 'confirmed-steps',})console.log(result)

API Signature

Request

Path Parameters

chatId: string

The unique identifier of the chat.

Request Body

task: 'confirmed-steps' | 'plan-exit-response' | 'answered-questions' | 'confirmed-permissions'

The task resolution data. The latest message in the active chat fork must be an assistant message blocked on the matching task type.

modelConfiguration?: object

Overrides for the model behavior.

modelId: 'v0-auto' | 'v0-mini' | 'v0-pro' | 'v0-max' | 'v0-max-fast'

Model to use for the generation.

imageGenerations: boolean

Enables image generations to generate up to 5 images per version.

Response (Stream)

The response is a text/event-stream. Each event is data: <JSON>\n\n where the JSON conforms to one of the following event types:

event: 'message' | 'message.parts.chunk' | 'message.usage' | 'error'

A single Server-Sent Events payload emitted by the streaming send-message endpoint. Each SSE event is data: <JSON>\n\n where the JSON conforms to one of the union members.

id: string

Unique message identifier.

chatId: string

ID of the chat this message belongs to.

role: 'user' | 'assistant'

Who produced this message.

createdAt: string

ISO timestamp when the message was created.

updatedAt: string

ISO timestamp when the message was last updated.

content: string

The trailing prose of the message — the agent’s closing summary, or the user’s message text. Empty string when there is no closing prose.

parts: ('text' | 'thinking' | 'file-read' | 'file-edit' | 'search' | 'bash' | 'tool-call' | 'agent-action')[]

Ordered list of parts that make up the message. Iterate to render the full narrative including thinking, file operations, tool calls, and prose.

type: 'text'

A block of text output by the agent.

text: string

Markdown prose written by the agent or user.

startedAt?: string

ISO timestamp when this part began.

finishedAt?: string

ISO timestamp when this part completed.

finishReason: 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'other' | null

Why generation ended. Null while the agent is still generating; once non-null, the message is final and safe to consume.

attachments?: object[]

Files attached to this message.

url: string

URL to the attachment.

name?: string

Original filename, when available.

contentType?: string

MIME type.

size?: integer

Size in bytes.

authorId: string | null

ID of the user who authored a user message; null for assistant messages.

usage: object

Token usage and credit cost. All values are zero on user messages and on assistant messages that have not yet generated tokens.

tokens: object

Token counts for this message.

input: number

Prompt input value (non-cached).

output: number

Completion output value.

cacheRead: number

Cache-read input value.

cacheWrite: number

Cache-write input value.

total: number

Sum of input, output, cacheRead, and cacheWrite.

creditsCost: object

Credit cost for this message.

input: number

Prompt input value (non-cached).

output: number

Completion output value.

cacheRead: number

Cache-read input value.

cacheWrite: number

Cache-write input value.

total: number

Sum of input, output, cacheRead, and cacheWrite.

object: 'message'

Initial and final message-state event. Emitted once at stream open with the freshly-created assistant message (empty parts, null finishReason), and once at stream close with the completed message.

On this page